pub fn convert_base(num_str: &str, to_base: u32) -> String {
    // TODO: 这里写逻辑
    //解析输入的字符串
    let num_vec = num_str.split('(').collect::<Vec<&str>>();
    let num = num_vec[0].parse::<u32>().unwrap();
    let from_base = num_vec[1].split(")").next().unwrap().parse::<u32>().unwrap();
    //转换为十进制
    //根据form_base转换为十进制
    let mut dec_num = 0;
    let mut index = 0;
    let mut num_mut = num;
    while num_mut > 0 {
        let remainder = num_mut % 10;
        dec_num += remainder * from_base.pow(index);
        num_mut = num_mut / 10;
        index += 1;
    }
    println!("十进制: {}", dec_num);
    //转换为目标进制
    let mut result = String::new();
    let mut num = dec_num;
    //十进制转换成十六进制标记
    if to_base == 16 {
        while num > 0 {
            let remainder = num % to_base;
            if remainder == 10 {
                result = format!("a{}", result);
            } else if remainder == 11 {
                result = format!("b{}", result);
            } else if remainder == 12 {
                result = format!("c{}", result);
            } else if remainder == 13 {
                result = format!("f{}", result);
            } else if remainder == 14 {
                result = format!("e{}", result);
            } else if remainder == 15 {
                result = format!("f{}", result);
            } else {
                result = format!("{}{}", remainder, result);
            }
            num = num / to_base;
        }
        return result;
    }
    while num > 0 {
        let remainder = num % to_base;
        num = num / to_base;
        result = format!("{}{}", remainder, result);
    }
    result
}
